Skip to content

Fix SSO profile token provider resource cleanup - #7546

Open
sivaharish31 wants to merge 1 commit into
aws:masterfrom
sivaharish31:fix/sso-profile-token-provider-cleanup
Open

sivaharish31 wants to merge 1 commit into
aws:masterfrom
sivaharish31:fix/sso-profile-token-provider-cleanup

Conversation

@sivaharish31

Copy link
Copy Markdown

Fixes #7545.

When using an sso_session profile, SsoProfileCredentialsProvider does not close the underlying SsoOidcClient through its token provider. This can leave HTTP connection resources and the idle connection reaper thread running after the credentials provider is closed.

Modifications

  • Retain the SdkTokenProvider as a field in SsoProfileCredentialsProvider.
  • Close the token provider during shutdown using IoUtils.closeIfCloseable.
  • Add tests verifying that closeable token providers are closed exactly once.
  • Add a test verifying that non-closeable token providers do not cause failures.

Testing

  • SsoProfileCredentialsProviderFactoryTest: 25 tests passed.
  • SSO module excluding SsoTokenFileUtilsTest: 85 tests passed.
  • The unfiltered SSO module run had one unrelated failure in SsoTokenFileUtilsTest.generateTheCorrectPathTest due to a Windows path-separator difference.

No changes were made to the unrelated failing test.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

@sivaharish31
sivaharish31 requested a review from a team as a code owner November 12, 2026 11:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SsoProfileCredentialsProvider.close() leaks the SsoOidcClient of an sso_session profile

1 participant